package com.jiazhong.spring.autowired.controller;


import com.jiazhong.spring.autowired.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @Auther:shuXin
 */
@Controller("userController")
public class UserController {
    @Resource
    private UserService userService;

    //@Autowired
    /*public UserController(@Autowired UserService userService) {
        this.userService = userService;
    }*/

    //@Autowired
    /*public void setUserService(UserService userService) {
        this.userService = userService;
    }*/

    public void save(){
        System.out.println("controller方法中的save被执行");
        userService.save();
    }
}
